#include "user_gpio.h"
#include "user_delay.h"
#include "user_init.h"
#include "user_uart_interrupt.h"
extern uint8_t Wireless_Mode;
extern uint8_t LoRa_1freq_CH;
void Get_Commu_Type(void)
{
	uint8_t commu1_val = 0;
	uint8_t commu2_val = 0;
	uint8_t commu3_val = 0;
	commu1_val = FL_GPIO_GetInputPin(COMMU_IN1_GPIO,COMMU_IN1_PIN);
	commu2_val = FL_GPIO_GetInputPin(COMMU_IN2_GPIO,COMMU_IN2_PIN);
	commu3_val = FL_GPIO_GetInputPin(COMMU_IN3_GPIO,COMMU_IN3_PIN);
	Wireless_Mode = (commu3_val<<2) + (commu2_val<<1) + commu1_val;
	if(Wireless_Mode==Nb_Mode)
	{
		SysPrintf("Wireless_Mode: Nb_Mode\r\n");
	}
	else if(Wireless_Mode==Lora_Mode)
	{
		SysPrintf("Wireless_Mode: Lora_Mode\r\n");
	}
	else if(Wireless_Mode==LoRaWAN_Mode)
	{
		SysPrintf("Wireless_Mode: LoRaWAN_Mode\r\n");
	}
	else if(Wireless_Mode>=LoRa_1freq_Mode)
	{
		SysPrintf("Wireless_Mode: LoRa_1freq_Mode\r\n");
		LoRa_1freq_CH = Wireless_Mode & 0x03;
		SysPrintf("LoRa_1freq_CH: %d\r\n",LoRa_1freq_CH);
	}
	else
	{
		SysPrintf("use default Wireless_Mode: Nb_Mode\r\n");
	}
}